using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

/* Game Timing
http://stackoverflow.com/questions/2570097/game-loop-and-time-tracking

http://www.dreamincode.net/forums/topic/99860-creating-games-in-c%23-part-i/
http://www.dreamincode.net/forums/topic/140540-creating-games-with-c%23-part-2/

*/

namespace LARS
{
  public partial class LarsForm : Form
  {
    StatusForm    MyStatusForm = null;
    ObjectManager MyObjMan     = new ObjectManager();
    Timer         MyTimer      = new Timer();
    int           TickCounter  = 0;

    public LarsForm()
    {
      InitializeComponent();


      MyObjMan.Collect();


      // Set and Start the Timer
      MyTimer.Tick    += new EventHandler( LarsForm_Tick );
      MyTimer.Interval = 60;
      MyTimer.Enabled  = true;
      MyTimer.Start();

      MyStatusForm = new StatusForm( this );

      MyStatusForm.Show();
    }

    void LarsForm_Tick( object sender, EventArgs e )
    {
      TickCounter += 1;
      MyStatusForm.ProgressTextBox.Text = TickCounter.ToString();
    }

    private void LarsForm_Paint( object sender, PaintEventArgs e )
    {
      e.Graphics.DrawImage( MyObjMan.image, new Point( 100, 100) );
    }

    private void LarsForm_ClientSizeChanged(object sender, EventArgs e)
    {

    }

    private void LarsForm_KeyDown(object sender, KeyEventArgs e)
    {

    }

    private void LarsForm_KeyUp(object sender, KeyEventArgs e)
    {

    }

    private void LarsForm_MouseClick(object sender, MouseEventArgs e)
    {

    }

    private void LarsForm_MouseDoubleClick(object sender, MouseEventArgs e)
    {

    }

    private void LarsForm_MouseDown(object sender, MouseEventArgs e)
    {

    }

    private void LarsForm_MouseUp(object sender, MouseEventArgs e)
    {

    }

    private void LarsForm_MouseMove(object sender, MouseEventArgs e)
    {

    }

    private void LarsForm_Closing( Object sender, FormClosingEventArgs e )
    {

    }

    private void LarsForm_MoveReSize( object sender, EventArgs e )
    {
      MyStatusForm.Location    = new Point( Location.X + Size.Width, Location.Y );
    }
  }
}